package cn.edu.whpu.config;


import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;


/**
 * @program: whpuenvmonitor
 * @description:
 * @author: Mr.Dai
 * @create: 2019-12-12 19:21
 **/
@Configuration
public class AppConfig extends WebMvcConfigurationSupport {
    /**
     * URL 映射
     */
    @Override
    protected void addViewControllers(ViewControllerRegistry registry) {
        //registry.addViewController("/index.html").setViewName("login");
        super.addViewControllers(registry);
    }

    /**
     * 资源路径 映射
     */
    @Override
    protected void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/**")
                .addResourceLocations("classpath:/resources")
                .addResourceLocations("classpath:/static/")
                .addResourceLocations("classpath:/templates")
                .addResourceLocations("classpath:/public");
    }
}
